<template>
  <div>
    <div id="head">
      <van-nav-bar title="跑步设置" left-arrow @click-left="onClickLeft" />
    </div>
    <div id="body">
      <div class="span-box">
        <p>语音设置</p>
      </div>
      <div class="func-box">
        <p class="p">语音播报</p>
        <van-switch v-model="checked" class="switch" />
      </div>
      <div class="func-box">
        <p class="p">播报频率</p>
        <select @change="changeValue" v-model="value">
          <option value="每一分钟">每一分钟</option>
          <option value="每两分钟">每两分钟</option>
          <option value="每三分钟">每三分钟</option>
          <option value="每五分钟">每五分钟</option>
        </select>
      </div>
      <div class="span-box">
        <p>其他设置</p>
      </div>
      <div class="func-box">
        <p class="p">屏幕常亮</p>
        <van-switch v-model="checked1" class="switch" />
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";
const checked = ref(true);
const checked1 = ref(true);
const onClickLeft = () => history.back();
const sessionValue = sessionStorage.getItem("value");
const value = ref(sessionValue);
const changeValue = () => {
  sessionStorage.setItem("value", value.value);
};
</script>

<style scoped>
* {
  margin: 0;
  padding: 0;
}

#body {
  height: 93vh;
  background-color: #f4f4f4;
}

.func-box {
  background-color: #fff;
  height: 50px;
  line-height: 50px;
  display: flex;
  justify-content: space-between;
  border: 1px solid #f4f4f4;
  padding: 0 20px;
}

.span-box {
  height: 40px;
  line-height: 40px;
  padding: 0 20px;
  background-color: #f4f4f4;
  font-size: 14px;
  color: #666;
}
.switch {
  margin: 10px 0;
}
select {
  border: none;
  outline: none;
}
.p{
  font-size: 20px;
}
</style>
